package ObjectClass

object CaseTest {
  def main(args: Array[String]): Unit = {
    val myBYDCar = Car04("BYD", 89000)
    val myBMWCar = Car04("BMW", 1200000)
    val myBenzCar = Car04("Benz", 1500000)
    for (car <- List(myBYDCar, myBMWCar, myBenzCar)) {
      car match {
        case Car04("BYD", 89000) => println("Hello, BYD!")
        case Car04("BMW", 1200000) => println("Hello, BMW!")
        case Car04(brand, price) => println("Brand:" + brand + ", Price:" + price + ", do you want it?")
      }
    }
  }
}

case class Car04(brand: String, price: Int)

